import {IDraw} from './Painter';
import Matrix from './Matrix';

abstract class Image{
  protected painter:IDraw;
  setPainter(painter:IDraw){
    this.painter = painter;
  }
  abstract parseFile(name:string):void;
}

class JPGImage extends Image{
  parseFile(fileName:string){
    let matrix = new Matrix('jpg', 2048);
    this.painter.doPaint(matrix);
  }
}

class GIFImage extends Image{
  parseFile(fileName:string){
    let matrix = new Matrix('gif', 1024);
    this.painter.doPaint(matrix);
  }
}

class PNGImage extends Image{
  parseFile(fileName:string){
    let matrix = new Matrix('png', 768);
    this.painter.doPaint(matrix);
  }
}

export {JPGImage, GIFImage, PNGImage};